﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using E_Commerce.Domain.Entities;

namespace E_Commerce.Domain.Interfaces
{
    /// <summary>
    /// 商品接口
    /// </summary>
   public interface IProductRepository:IRepository<Product>
    {
        /// <summary>
        /// 显示+查询+分页
        /// </summary>
        /// <param name="pageIndex">页索引</param>
        /// <param name="pageSize">页大小</param>
        /// <param name="totalCount">总条数</param>
        /// <param name="pName">商品名称</param>
        /// <returns></returns>
        List<Product> GetProductsAsync(int pageIndex, int pageSize,out int totalCount, string pName = "");
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        Task<int> DeleAsync(int id);
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>

        Task<int> Insert(Product p);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>

        Task<int> UptAsync(Product p);
        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        Task<Product> FillAsync(int id);

        /// <summary>
        /// 加入回收站
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        Task<int> UptStatusAsync(int id);
        /// <summary>
        /// 还原
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        Task<int> DownStatusAsync(int id);
        /// <summary>
        /// 显示回收站
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        List<Product> AgainAsync();
        /// <summary>
        /// 商品详情
        /// </summary>
        /// <param name="id">商品表主键</param>
        /// <returns></returns>
       ProductSpecification ProductdetailsAsync(int id);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id">分类表ID</param>
        /// <returns></returns>
        Task<ProductTypes> CommodityAsync(int id);

    }
}
